import localforage from 'localforage'

export async function setStorageItem(key: string, data: unknown) {
  return await localforage.setItem(key, data)
}

export async function getStorageItem(key: string) {
  return await localforage.getItem(key)
}

export async function removeStorageItem(key: string) {
  return await localforage.removeItem(key)
}

export async function hasStorageItem(key: string) {
  return !!(await localforage.getItem(key))
}
